Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Autofill password import] Misc fixes #1184

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

dbajpeyi
Copy link
Contributor

@dbajpeyi dbajpeyi commented Oct 31, 2024

Asana Task/Github Issue: https://app.asana.com/0/1205996472158114/1208671198302487/f

Description

  1. Bugfix It seems like I missed out on replacing indexOf by includes, however I replaced the functionality 😄
    Original PR: [Google password manager] Android isolated module for password import  #1157. This was causing login to break, and also causing other animations to break.
  2. Feature Modifying the animation approach by adding an overlay element, so that the main element doesn't accidentally scale and transformation is only added to the overlay
  3. Bugfix Adding a timeout before animation, as sometimes scrollIntoView fails if the layout is not fully rendered (edge case).
  4. Feature Some fixes in styles as suggested in the ship review.

Testing Steps

  • Build android (on the branch feature/craig/autofill_gpm_ui_to_launch_from_password_manager) with the config https://jsonblob.com/api/1301563859532636160
  • Hit the fire button, go to "passwords" menu
  • Start importing password using the new "Import passwords from google" button
  • You should be able to go through the whole flow (including adding new account on google.com)

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

Copy link

netlify bot commented Oct 31, 2024

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 7d4a3af
🔍 Latest deploy log https://app.netlify.com/sites/content-scope-scripts/deploys/672a2c0e74cffd0008bb3a4e
😎 Deploy Preview https://deploy-preview-1184--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dbajpeyi dbajpeyi changed the title fix: supported path [Autofill password import] Fix supported path Oct 31, 2024
Copy link

github-actions bot commented Oct 31, 2024

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

Copy link

github-actions bot commented Oct 31, 2024

[Beta] Generated file diff

Time updated: Fri, 01 Nov 2024 14:13:46 GMT

Android
    - android/autofillPasswordImport.js

File has changed

Integration
    - integration/contentScope.js

File has changed

@dbajpeyi dbajpeyi marked this pull request as ready for review October 31, 2024 15:08
@dbajpeyi dbajpeyi requested a review from a team as a code owner October 31, 2024 15:08
@dbajpeyi dbajpeyi changed the title [Autofill password import] Fix supported path [Autofill password import] Misc fixes Oct 31, 2024
@dbajpeyi dbajpeyi force-pushed the dbajpeyi/fix/supported-paths branch 5 times, most recently from 297ad13 to 11e20f0 Compare November 1, 2024 12:36
@dbajpeyi dbajpeyi marked this pull request as draft November 4, 2024 13:33
@@ -41,7 +41,7 @@ export class UpdateNotificationService {
*/
dismiss () {
this.ntp.messaging.notify('updateNotification_dismiss')
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some new eslint changes seem to have forced this when I did a lint-fix

@dbajpeyi dbajpeyi marked this pull request as ready for review November 5, 2024 09:58
if (shouldTap) {
this.autotapElement(element)
} else {
setTimeout(() => this.animateElement(element, style), 300)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this 300 a constant, mainly to document what the wait is for a little bit (comment is probably unnecessary with a well named var).

const { top, left, width, height } = elementToCenterOn.getBoundingClientRect()
overlay.style.position = 'absolute'

overlay.style.top = `calc(${top}px + ${window.scrollY}px - ${isRound ? height / 2 : 0}px - 1px - ${style.offsetTopEm}em)`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer these ternaries as variables outside of the template string to simplify the expression a little. Feel free to skip if you care about keeping.

if (shouldTap) {
this.autotapElement(element)
} else {
setTimeout(() => this.animateElement(element, style), ANIMATION_TIMEOUT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is safer:

const domLoaded = new Promise((resolve) => {
  if (document.readyState === "loading") {
    document.addEventListener("DOMContentLoaded", resolve);
  } else {
    resolve();
  }
})
Suggested change
setTimeout(() => this.animateElement(element, style), ANIMATION_TIMEOUT)
await domLoaded
this.animateElement(element, style)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants